<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>沟通记录表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="rskCommRec_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <%--<div class="fieldBox col_100">
            <div class="label">客户名称</div>
            <div class="field">
                <input name="cstId" id="cstId" type="text" class="ui-textbox" value="${rskCommRecVO.cstId}" validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>--%>
        <div class="fieldBox col_33">
            <div class="label">催收时间</div>
            <div class="field">
                <input name="collectTm" id="collectTm" type="text" class="ui-textbox" value="${rskCommRecVO.collectTm}"
                       validate="{required:true,maxlength:0}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">催收方式RSK0001</div>
            <div class="field">
                <select name="collectWayCd" id="collectWayCd" data-value="${rskCommRecVO.collectWayCd}"
                        validate="{required:true,select:true}">
                    <option value=" ">请选择</option>
                    <c:forEach items="${collectWayCdList}" var="item">
                        <option value="${item.code }">${item.codeNm }</option>
                    </c:forEach>
                </select>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">催收员ID</div>
            <div class="field">
                <input name="collectUsrId" id="collectUsrId" type="text" class="ui-textbox"
                       value="${rskCommRecVO.collectUsrId}" validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">欠款原因RSK0002</div>
            <div class="field">
                <select name="ovdReasonCd" id="ovdReasonCd" data-value="${rskCommRecVO.ovdReasonCd}"
                        validate="{required:true,select:true}">
                    <option value=" ">请选择</option>
                    <c:forEach items="${ovdReasonCdList}" var="item">
                        <option value="${item.code }">${item.codeNm }</option>
                    </c:forEach>
                </select>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">联系人</div>
            <div class="field">
                <input name="lkMan" id="lkMan" type="text" class="ui-textbox" value="${rskCommRecVO.lkMan}"
                       validate="{required:true,maxlength:60}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">联系电话</div>
            <div class="field">
                <input name="lkPhone" id="lkPhone" type="text" class="ui-textbox" value="${rskCommRecVO.lkPhone}"
                       validate="{required:true,maxlength:20}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">催收记录</div>
            <div class="field">
                <textarea name="collectRem" id="collectRem" type="text" class="ui-textbox" cols="25" rows="4"
                          value="${rskCommRecVO.collectRem}"
                          validate="{required:false,maxlength:200}">${rskCommRecVO.collectRem}</textarea>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">催收结果RSK0003</div>
            <div class="field">
                <select name="collectRstCd" id="collectRstCd" data-value="${rskCommRecVO.collectRstCd}"
                        validate="{required:true,select:true}">
                    <option value=" ">请选择</option>
                    <c:forEach items="${collectRstCdList}" var="item">
                        <option value="${item.code }">${item.codeNm }</option>
                    </c:forEach>
                </select>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_33">
            <div class="label">催收成本</div>
            <div class="field">
                <input name="collectCost" id="collectCost" type="text" class="ui-textbox"
                       value="${rskCommRecVO.collectCost}" validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
    </div>
    <div class="btnsBox">
        <span id="saveRskCommRec_Btn" class="sq-button sq-button-hasicon l-dialog-btn-ok">
        <i class="sqBtnIco_10"></i>保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>

</form>
<script>
    $(function () {
        var rskCommRecId = "${rskCommRecVO.id}";//主键ID
        $("#rskCommRec_form").ligerForm({
            validate: true
        });
        /*保存*/
        $("#saveRskCommRec_Btn").click(function (event) {
            var form = liger.get("rskCommRec_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (rskCommRecId == '') {//新增
                _url = '<%=path%>/risk/rskCommRec/add.do';
            } else {//修改
                _url = '<%=path%>/risk/rskCommRec/modify.do?id=' + rskCommRecId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();

                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
</script>
</body>
</html>
